/**
 * Interface for a Frame. Frame format:
 *
 * Byte 0 = header (0x7e)
 * Byte 1 = end?
 * Byte 2 - 6 = seq
 * Byte 7 - 11 = ack
 * Byte 12 - 16 = CRC
 * Byte 17 - 19 = length
 * Bytes 20 - 20+Length-1 = Data
 * Bytes 20+length - 20+length+1 = footer (0x7e)
 *
 * @author Timothy Flynn (trflynn@wpi.edu)
 * @version April 12, 2012
 */
#ifndef _FRAME_H_
#define _FRAME_H_

#include "common.h"
#include "Packet.h"

class Frame {
public:
	Frame();
	Frame(char *);
	virtual ~Frame();
	char *toString();
	void stuff();
	void unstuff();

	// Fields intentionally public for convenience
	bool end;
	short seq;
	short ack;
	unsigned short crc;
	short length;
	char *data;
};

#endif
